
#ifndef GAMEWINDOWLABEL_H
#define GAMEWINDOWLABEL_H


#include <QObject>
#include<QLabel>
#include<QWidget>
#include<QPainter>
#include<QDebug>
#include<QKeyEvent>
#include<QtMultimedia/QSoundEffect>
#include<QTimer>
#include<QList>
#include "enemyword.h"
#include<QTime>
#include<QCoreApplication>
#include<QFile>
#include<QMessageBox>


class GameWindowLabel:public QLabel
{
    Q_OBJECT

    int level;//等级1-10
    int score;//按键次数，失败时显示分数

    bool begin;

    QSoundEffect *effect;
    QSoundEffect *effectboom;
    QSoundEffect *backsound;
    QPoint firePoint;
    QPoint targetPoint;

    int gameDeadLine;

    QTimer *timerCannon;
    int cannonLen;

    QTimer *timerRunning;


    QList<enemyword *> wordList;

    enemyword *lockedWord;
    QStringList wordTable;

public:
    GameWindowLabel(QWidget*parent = 0);
    void getKey(const QString &c);

    void generateWords(int count);

protected:
    void paintEvent(QPaintEvent *e) override;
    void mouseMoveEvent(QMouseEvent *ev) override;


};

#endif // GAMEWINDOWLABEL_H
